Sample18: Fixed checking parameters logic.