fixup strtok usage and handling of wrong parameters