Fixed bug in python file reading and writing and finished ruby tests.