Bug fixes

Annoying errors :P