Fix some bugs in the new rake build process

Please please please replace this by invoking bootstrap :-)