Some bug fixes, build still not bulletproofed though.