added linenumbers to all fetchxx() functions

also added code for checking 'valid bits' on return