metaprogramming bugfix