Improved check_str() a bit.