Fixed multiple major problems with primitive and added debugging functions and messages.