Bug fixes

Fixed an SQL state error while deleting pages containing this field in
certain circumstances