add explicit casts, silence more warnings