Call dynamically created function name

You don't have enough elements in "funcs" - "rand(4)" returns 0..3 inclusive.
Otherwise, the code is fine.