small fixes to length