Fixed compile function so first argument is the compiled as the filename for the output