Nonzero residuals - static equations

That may well be. You should only do exp()-substitutions once the model works. Generally, I rather recommend appending logged values. See