tests, better errs and docs