small improvements to glitch (including type)