Renamed instance id record to index to better reflect its usage; fixed potential overflow bug in msig_reserve_instances().