Merge pull request #1266 from jmaas/master

Several fixes