Fix issues 11 and 12 reported by Martin Ettl.