Remove BASHisms to increase portability