Fixed typechecking issue