Bugfixes cleanups