a few minor code fixes.