update buffer length object type to try and avoid segfaults