Add self scope to pattern

Closes #54