Fixed handling of BY parameter.

Fixed handling of BY parameter to allow missing or non-crossed vars.