Bug/6

This should fix the problem (it has a little urgency) but needs more testing.