fixed bugs in C string implementations
cleaned up implementation of C library string functions