Fixed SQL query result serialization problem in policy history