Fix compilation warnings and pref test.

Fix compilation warnings and pref test, and comment.