More tests and better config handling