Removed some debugging statements, raise error instead of exiting