Patch from Ben Hutchings to fix an error-checking goof: Keen