Fixed masking bug in linear scaling function