Fixed wrong throws, closes #923.