Reapplied Caglars commit 4fabcace2b733403f293c174283e412164bfe7bf which had not been...