fixed minor code issues