Fix invalid reference
Add closing state, and send CLOSE event, transitioning to CLOSED on receipt of that event