Fixed bug in standard deviation calculation

@dcposch