Ported changes from old master
=operator ported manually
Merge pull request #12 from romanchyla/master-next-test

Ported changes from old master