a few minor bug fixes.