Fixed an issue with lengths being undefined.