Type checking partially working