Replace the double dispatch trick by multidispatch!

Fix #38.