More debugging code and error checking code being changed.
Fixing some freeing memory issues. Changing some debug information.