Minor: Guarding class-cast assumption