Some more bugs fixed
Bug fixes. Again.