Fix non-closed if-statement