Handling bad swarm and doing some minor cleanup