Fixed a bug in getLengthWeight