fix bug where 'self' keyword sometimes prepended by scope modifier