Catches KeyErrors and removes unnecessary setupcon calls.