More random bugfixes (no pun intended