This paper introduces bias-corrected estimators for nonlinear panel data models with both time invariant and time varying heterogeneity. These include limited dependent variable models with both unobserved individual effects and endogenous explanatory variables, and sample selection models with unobserved individual effects.