various fixes

@the-apathetic-w 

Fixes to unbreak the build