Change directory in working during upgrade. Fixes #185