Fix pencil overflowing

Contents from one pencil would overflow into the following pencils.