Added error packet and some debugging and extra testclass methods