Merge pull request #937 from nulltoken/fix/issue_936 refs: prevent locked refs from being enumerated