Add docs, fixed some tests