fix construction of nlmer deviance function