added topdoc, fixed build, adjusted tests