Adding $this = $( this ) where appropriate

Change-Id: I796311b5f5422909ea70d448adbca45def9f1cac