Fix issue with double casting.