Avoid warnings about undefined values
Use like instead of ok and regexp matching for better output