Made initial read actually work.
Fixed some compilation errors.