Replace deprecated 'safe' option, update tests