fix bug where class context in a class's methods would be confused for the context of the class itself