Fix issues in print_pat command