Fix issue with calling the return value of a method as a reference with empty().

Signed-off-by: Se7enChat <se7enchat@zoho.com>