Merge from @filinpavel - closes #161