Added Felix's bug fix for type plugin