use mapcar instead of mapc where there are no side effects

Stopped working for me after a recent update (I'm on Emacs 24.3.1, but I'm not entirely sure when it stopped working).  Here's the fix.  This also fixes a compile warning.