fixed parsing, replaced bzero and bcopy with memset and memcpy