Slightly improved error handling
Increment for publish