Added shared function get_deposit_filename; other small fixes.