Added custom errors.
Added some tests.