Fixed some database problems for pages