Fixes for weird errors