Re-order library linking.
Fix compile warning.
Fix compile warning.
Fix compile warnings.
Fix compile warnings.