Beutify composite code
Corrections to padding length calculation and special row detection