Fixed scoped and reverted string detection.