Partially defined cocycles and the Maslov index for a