Fixed possible bug in VM. Added coverity rules to makefiles.