Tidied up tests, added config validation