fix formatting

(cherry picked from commit 8d706c320bd4d3a7eb32d1bacdecddd55233f870)
bools reworked to flags
npe fix
Merge branch 'master' into stubRework
fixed parsing for vars