Some bugs fixes

Still the else-if problem