Fixes #37. Also Fixes NIF-10001. The fix for #37 only works for level=1.