There's a typo here.  I'll fix it as soon as possible.  Also is there a better way of doing this instead of a type switch?