Fix casting