bug fixes in building
more fixes to building