Prevents "freezes" by forcing stop() on shutdown