#2553 for 1-3-stable

This is the same as #2553, but is for the 1-3-stable branch. The only difference is the code in adjustments.rb, referencing the `locked` attribute rather than the `state` atribute.