ensure that series created only if data array not empty #179

Fixed thE problem of creating series if the data array is empty, as described in issue 179