Fixed working directory logic for post-merge script