fix #332 - ensure there's always a valid current directory