Fixed bug in function for deleting facts and free-ing memory,