Improvements and fixes

Here is patches to run anvil on grizly and some improvements.
Tested on centos 6.4.