Make wd() work. Fixes #374