Make the expectation a little more generic. Closes #759