Moved draw restore to the right place
debug can be private, so let's do that