Fixed unsequenced compiler warnings and dangling else