Fixed SMSMAX bug (wrong elif)