Better instance checking in constructor.