Fix standard deviation, close #1896