Added some type casts to avoid warnings produced by GCC 4.