Merged arlm's branch with master to fix an issue.