Fix keyboard offset calculations