Merged last updates from maintenance branch

For details on patch see #162.