fixes bugs introduced by misleading use of strncmp