More bugfixes in core.