Cleaned up the config and fixed some minor bugs