Fixed issues with debug script