Fixed a couple of function definitions