Improve and clean up test/debug methods.