Fixed some minor coding errors