Added pagination, various fixes