Fixed python2.6 file open bugs; fixed OSX library file extension bug.