patch bugs in class.calibrefx.php and update test case