Fixed coding errors

Applied corrections to file based on forum posting documenting errors.