fix bugs

syntax and small issues