fix settings page and add tests
Merge pull request #1073 from matiu/bug/settings

fix settings page and add tests