Made some minor code improvements.