Adds tests and improves output messages