More bugfixes for issue #1248