a few fixes by nebeans
fixed a pretty stupid bug
Merge remote-tracking branch 'origin/master'