Fix mod/lock and mod/leader return error codes.
Merge pull request #472 from benbjohnson/fix-error-codes

Fix mod/lock and mod/leader return error codes.