Fixed a bug with dynamic dispatching