Updates to Debug system and fixed threading issue