Fixed errors with function definitions. (Now works in VS 2012: Debug and Release)