When I run in to LEO doing a 12031 check, I plan to comply with inspection but respectfully only give my name and address. I learned the hard way as a youth "not to talk to police". Nothing good will come of it. Their only goal is to get you to admit to breaking some law. I also find it strange that most LEOs I encounter take my silence as an offense to them, it often "escalates" the situation. But I'd rather tick off some cop by not answering questions than get a ticket or go to jail.
I made many mistakes while talking to police and the only way I learned was repeated encounters with them, so keep it up
Glad your encounter went well.