Fix error when defining methods.