I think this is your issue is ...
If your heightmap is 64 x 64 pixels you can only have 0 ... 63 height points rather than 0-64 which you seem to be doing.
In your getcolor section your also going from 0-64 so the last heightpoint cannot be read as it's outwith the image.
I would also recomment using unwelded quads to build up the terrain so that it can be textured per quad .. it also makes the terrain easier to build.
Stevie
If your heightmap is 64 x 64 pixels you can only have 0 ... 63 height points rather than 0-64 which you seem to be doing.
In your getcolor section your also going from 0-64 so the last heightpoint cannot be read as it's outwith the image.
I would also recomment using unwelded quads to build up the terrain so that it can be textured per quad .. it also makes the terrain easier to build.
Stevie