Fix bug 874857 - Separate optimization from NODE_ENV