Fix #69, needs more general approach