Fix log, refactor get_durability, fix switch primary