Corrected check for classname to remove namespace.