Reduce the amount of memory used for handler names

- Fixes #1123