Pass config through more functions and fix dialyzer errors