Fix inheritence
Fix template matching