Inline type checks

This results in better code being generated as well as fewer stack frames at runtime.