Fixed wrong parameter order in substr