Address review comments, remove error case and return 0 instead as required by tests