Set maximum number of pages to 1024 and fixed bug with seek()