Fixed class cast