Fixed recursive search on OS X and Linux