Fixed up last error with explicity checking invalid argument to fun