Add docs, fix compile errors.