Fixed sign error, added further tests.