Fix possible undefined methods in inherited classes