Avoiding the warnings during the Chern number calculation