Corrected length bug