Moved debug flag stuff