Add unit test and wiki documentation. re #6922

Also removed compiler errors