Credit modelling and regime-switching