Fix some (not entirely correct in practice) compiler warnings.