Bug fix in smartparens hooks