Cast exception

Do not cast object.
See https://trac.openmicroscopy.org.uk/ome/ticket/12374

The problem is difficult to reproduce see ticket for details.