Update to better support debug mode