lib replace: Fix detection of features