Fixed bug with using raw lengths pointer instead of copying