Various bugfixes
Even more bugfixes