Fix for missing 'end'