Fix #174, was only partially fixed