Pull request for better debug and other things

Better debug is always a massive benefit.