some minor code fixes