fix minor syntax and processing errors