Only use logger in debug mode in time critical paths. More documentation and some more error checking