Fix some errors with debug