The massive end of the luminosity and stellar mass functions: Dependence on the fit to the light profile