Fix bug 428, add test which catches exception. What an annoying little bug.