Made type settable by default.

This is to support Enum type in addition to callback, which require
type to be set dynamically.