Fixed a type and added exception