Performance and bugfixes