Finally some bugfixes