More correct comparing of type