Fix getting ami-id from metadata