So there were two errors, in this block. I fixed one with the `$fillLength` check and created one with the changes in 129-131. Everything is working properly in c3f7ebd892f1dc4d53da69736701927f1862e465