On branch master - fixed a few bugs

- pstrncpy should be always 0 temrinated.