fixed several bugs with syntax