Make fix for #508 work for empty posts, fixes integration tests