Fixed errors.

Invalid parameter passed undefined "err". Made it pass null. Also referenced an undefined returnCodes object. Defined it.