Fix some small exceptions that sometimes occur

Mostly harmless