Fix minor code issues