Added exception if passed an invalid type param
Closes #4964