fixed list_classes bugs and bad match