Update from myurasov:master

Trying to update my fork with patches from @myurasov