Bugfixes and modern code