Fixing type misidentification bug