Bugfixes for core patch