Fixed a -1 bug in YaPI
Updated testsuite.