Some bugfixes and setup