Fixed inverted orientation and wrong search of slice number by parameter value.