Fix #461 regression, thanks @happydawn for the report