Fix #1471 - add explicit type cast.