Fix for missing intermediate variables introduced by #101

This preserves the behavioral change introduced in #101, but adds intermediate
variables to avoid PHP "strict standards" errors.