Fix for FEND-1283.  Casting values correctly now