added type_*() methods, fixes #7