Problems with Talon SRX Closed Loop Velocity Control

I’m having problems with getting the closed loop velocity control to work. I am using a CTRE Mag encoder and it is wired up properly. The code that I am using is exactly from the examples that are on the ctre github for example code. What is happening is that when button 1 is held and I move the joystick, the motor goes full speed and even if the joystick is at the zero position the motor will continue to move at full speed. Another thing I noticed was that if I was holding button one, started the motor with the joystick, let go of the button, and then hit the button again the motor would start back up. The motor had to be completely at rest for it to reset. Am I doing something wrong? Is this a bug? Please

Initialization of the talon:

Code that runs the talon:

Please read…
section 16.31. My Closed-Loop is not working? Now what?
…in the talon srx software reference manual.