Merge "Fix potential bugs in allocation tracker"