Check for empty lengths and set to 0