Tweak docs and add some error checking