Fixed some syntax&logic errors ...

the benefits of a crappy language without propper debuging tools ...