Fix reduction bug regarding empty functions.