Fix incorrect handling of leading spaces in text wrapping