Add tests for TypeMap and fixed test for Engine