Fixing a critical bug in semantic type selection