Rearranged error functions and fixed string support