Max&Michal: minor improvements tests and code in PDF rendering