Bugfixes and stability improvements