Fixing debug errors