Removed more unused variables.
Use much more safe mystrlcpy() function to copy strings.