Cleaning up some Valgrind errors in illumination correction and bugfixes, adding debug outputs, and more to python wrapper