Fix some warnings in mac and add magic and random_key to repo rpc