The fixes to this method aren't actually relevant to this PR (or this commit). I happened to noticed I merged in one of the recent PRs wrong. This should've actually been a separate PR, sorry.