Fix broken pipe and source functions.sh

Signed-off-by: Robert Breker <robert.breker@citrix.com>