fixes

Merged Ilya Dyakun requested to merge fixes into insert