Fixing logic bug in close helper methods.