Bugfixes and package tweaks