Check if the argument passed to flex() is a list and return the right value. Fixes #10.

This fixes #10.