fixed bash/sh compatibility issues