Credit allocation in heterogeneous banking systems