Some bugfixes and other tasks