Feature 1295 by pjohans: minor fixes