Bugfixes, but still untested