Remove buffered io stuff
Untabify and reindent
AFP fixes