Bugfixes and additions