Changed NotImplementedError to TypeError