Fixed minor code issues