OPAL-1724: Fixed error and test