various bugfixes added perftTest