Fix #1040
Updated tests
Optimizations
Interned strings