Fixed a bug in the linearity test