Another part of Issue #27

Sorry about the multiple branches/commits. The github web interface is a bit limited...