Replaces https://github.com/steemit/condenser/pull/3272 and https://github.com/steemit/condenser/pull/3276