fixed #71, fixed #72, tests updated