Fix length bug