Simplified pretty_print_rows and fixed one bug in it.