Added --sync argument and fixed wrapping bug.