Timing issues

I have Cubase elements 6.

I have timing issues. Like when I do a drum track for 4 bars, I replay it and the timning of the notes are off.

Or lets say I do a piano track, perfectly timed in with the metronome, but when I replay it is off beat.


Can somebody help me out?