Added compact in case array has nils