Add a few explicit casts