Corrects relative difference function.
Adds a new basic test.