Fixed compiler warnings, mostly lossy conversions