As pointed out, should be (isinstance) rather than (type) in defmain docs