fixes #695, also avoid code duplication in checking data input when
setting Trace.data