Fixed problem with debug code