minor bug fixes

re-shuffled template in internal.core.generic in order to get a test
variant to compile.