Fixed the error with primitive application within functions.