Fixed #274
Fixed #258
Merge pull request #276 from umpirsky/fix/20-08-2013

Fixes