Hi Aaron,
Try to first store the value in a int variable and then cast that variable.
It worked for me in the past.