Fix bad cast in item selector