Added nonempty repr/str tests and fixed a bug in both functions.