Bugfixes in new functions