Fixed NPE in getTotalPages due to uninitialized model of number of pages.