Fix #5 by correctly respecting the 'cwd' option