Std calculation fix