Added tests, fixed unwrapper