metaprogramming mistakes corrected