Bugfixes and stuff