Fixed #378.

Not a nice fix but at least works...