Correctly handle no interval when converting to json