Shouldn't have really used strncpy, for something that is effectively binary data. Also cleanup structs when defining instead of adding memsets everywhere.