Better instance checking