Tested the module with the drupal services disabled. There were a bunch of notices and problems associated with this. Cleaned these up and added some additional debugging messages