Fixed the case where n == 0.