Fix: a memory allocation bug for regex structure;
Fix: a few bugs related to windows platform.
Add: minor changes and fixings to the building system.