added linear bias to fits
improved error handling