Updated library.
Added lots of debugging stuff.