Fix memory access, fix settings file