Settings 4 bug fixes. Removing unused code. Adding comments.