Implement /rangelock
Fix style errors in pull request #1221