Fix to work out bounds of diagram and hence close #6