Fix for isfile() check in discover()