Fixed bad math and population errors.