Fixed sorting and viewCollection issues