Fix various build errors

I swear this worked last night...
Remove unnecessary dead code