Changed open mode from 'rb' to 'U'