Fix shorten-64-to-32 warnings
Fix sign-conversion warnings