Fix typo in return value check: 1 should be -1