Fixed more warnings

Typecasts and the like