merged against upstream master
merged and fixed against DaftMonk/passport