Fix a string as pointer bug and fix some tests