Need to nudge recorded midi tracks to be in sync

When I record midi drums(Fluidsynth) to disk the playback is out of sync with the original midi track.
I have to delay the track by 144 ticks (at 120 bpm) to be in sync with original drums and metronome.
The same also happens when I record drums from Hydrogen.
Can anybody tell me why this happens and how to fix it.

Thanks in advance.