Fixed class cast exception.