Corrected a couple of scalar functions