Minor clean and bugfixes