bug fixes for fitted.secrgam