Small fixes

wouldn't it make more sense to do a if legend rather than unless !legend