Minor tweaking and removing of debug messages.