Fix issues found by @staabm