pulling from peter thiemann fork

Update this branch with work done in peter thiemann's fork.