tests now passing, fixes #18