Varfix5

Each commit fixes completely irrelevant bugs, so please review each one separately. The one that started it all was the last one: fixing remote copying of zero-sized files. It now includes 2 acceptance tests (plain and encrypted copying).