Fixed bug where elements werent selectable when editing an existing fact. added better and more consistent error checking.