Fix NoneType error in magic connection closing