Add unit tests for 'type' AttributeError fixes.