Fixed working dir (patch provided by @vsalaman)