Fixed a few settings issues, added some tests for that.