Added function export statements so they actually work from the command line.