Code style fixes + small bug fix