Alloc length fixed
uncomment if condition
Merge conflicts solved