several bugfixes and windows 7 compatibility