Quest files and revards count incorrectly substracted

When completing quests, files from disc (home directory) are incorrectly removed so the resulting quantity of affected file is negative

Example:
DoSCDatabank gateway, 5 pieces of EncryptionKey.V on disc
The quest should remove 2 pieces

Expected result: 3 pieces of EncryptionKey.V on disc
Actual Result: -4 pieces of EncryptionKey.V on disc

When buying more keys the count remains. Solution is to delete the file and buy it afterwards.