Moved temporary sanity tests to functions