A few bug fixes.
Merge pull request #9 from jasnell/fixes20140428

A few bug fixes.