different fixes and code improvements
Merge remote-tracking branch 'origin/master'