Added result type checking.