Relative error computation capsulated and works now correctly.