improve settings debugging

Make the settings variables a reference so ownership is more obvious.
This harmless change is responsible for the most changes.