Fixed the fact that threads spawned by the controller were not being killed.