fix bug preventing locking a scoped and a non scoped account

fix bug preventing locking a scoped and a non scoped account at the same time.

The added spec fails without the to_s due to an ArgumentError for the <=> operator ( the second scope was nil).

Added a second commit to simplify code and remove the if statement.