Don't use deprecated function.
Fix signed/unsigned warnings.
Merge branch 'master' into super_duper