Repaired fix of #63, was not properly tested afterall.