Adds tests and debugging messages.