Add unit test parsing + checking of autogenerated failsafe, fix syntax errors