Fixed "UnboundLocalError: local variable args referenced before assignment"