Small bugfixes here and there