Added some debugging functions.