fix junit after #681 + some special case logic fix