Fixed 3x-index to handle NaN in output as NULL