Adds length-getter methods.