bugfixes and small additions