Added handling of logical vectors.