Fix tests for is_safe