Fixed type selection bugs.