Fix dangling else (hopefully the right way)