Fix for #2504

Additionally, fixed method signature to match Poco.

This is a fix for #2504