More safe and reliable checks

Switched from '-r' checks to simple array checks.