Fixed wrong config variable and cleaned up a bit