Fixed a bug with the check for dimensionless quantities