Recommit fixes done in 5dca5fb (seems we've lost them during last merge with Richard's work)