Made a few changes to support testing and bug fixes