Fix compile error

- You can't assign a temporary to non-const reference
- You can't use const reference here as map doesn't have operator[] const