A few fixes and cleanups for the #52 pull request.