Fixes and debug mode