Changed function param checking to assertions