Fix bug 3178, and added units