Fix for #215 and some other related improvements

There should be always `{` and `}` around conditional statements, it's a best practise.