Fixed minor coding errors