Fix a bunch of things.

(@stefanpenner / @rjackson)