Forgot to cast some variables.