Removed unused namespaces.
Changed template behaviors.