Made some implicit type-casts explicit to suppress complier warnings.