Fixed bug in getting preferencelist, add more comments