Fixed potential error with stdout encoding
Testing with coverage