cprepair bugfixes and docs