Fixed various issues that the broken build caused.