Add tests and fixes for thermal printer library.