Use mock.patch for patching
Some small fixing