code cleanup
fixed minor errors