Implement env debug mode
Some random changes