Ion dynamics in non-perfect quadrupole traps