Fix buggy string instructions and enhance unit tests.