Fixed bug in gaps formatting