Added/fixed tests, docs and config flags