Fixed bugs in building; added test to make sure people don't keep building for nothing