Fixed some compiler warnings with implicit cast.