Imported modified versions from Sumatra
Merged changes from master to sumatra branch