Add more robust configuration options

Added some test cases to manually test (and do automated testing later)