Add leftrim and remove pid for WIN32