More bug fixes

Ergh... that's enough.