Please note that a coffee function actually returns the last thing that was evaluated in a function. For example, checkForExistingFile function will actually return another function compareStreamWithString as its result if you don't have an explicit return at the end of checkForExistingFile. This is a quirk of coffee that you need to be aware of, and it could be fixed by putting explicit returns from "void" functions that expect to return undefined.