bugfixes and small changes to base classes