Minor bug an syntax fixes, style changes