Added self argument to lock and unlock.

Seems that self argument was forgotten on coding :)