Merge pull request #47 from stdweird/count_negate

Add support for count and negate
Properly handle tmp files created by editors