More robust bed leveling method (least squares fitting)