Fixed an issue that could happen if the plugin received no data from a query

Fixed an issue that could happen if the plugin received no data from a
query
Improved some debug messages