Link fix attempt 2.
Fixed closing bug and added docs.