Fixed a bug that would cause errors at end of observations