fixes in buffer cache and prime generator