Testing and bugfixes