Type and scope check