Added better debugging support