WIP for #57 but bug still here
Fix #54