Correct some mistakes in terms of calculating first dev and second dev