Type casts to make example work with the compiler