Fixed warnings.
Fixed incorrect error test.