Fixed #214 by properly re-using the logic.