Shouldn't you be adding $MACHINENAME here too:

$current_subkey = enumkey( '\\' + $MACHINENAME + '\' + $ADAPTER_REGPATH , $index_adapter )