minor code fixes