fix #661, #598

also fix https://github.com/RS485/LogisticsPipes-Dev/issues/39