Fixed error if observation array is empty