fixed a couple of format and dangling else warnings