This and the above function do not brace all conditional blocks. I would strongly advise to do so (in general, not just here).