To get your Home and End keys working properly on Mac OS X (Tiger and up, including Mavericks), simply open the Terminal and do this:
$ cd ~/Library
$ mkdir KeyBindings
$ cd KeyBindings
$ vi DefaultKeyBinding.dict
Put these lines in that file, including the curly braces:
{