Is this something to expect when they code is a little out?
Yes.
In ordinary human languages, we gloss over things such as misspellings or inappropriate grammar. Computer languages make no such allowances, they just follow the instructions - as far as possible. Sometimes that means a crash, or just incorrect results.