Fixed setsockopt and unref.