Fixed two bugs in allocation
Removed sillyness from build scripts, no point in making them complex because we'll switch to cmake soon.