Fixed bug where debug setting not being passed through