Bug fix in vacancy calculation