Fixed invalid JavaScript produced on empty if