Fixed errors/warnings with GCC.
Finished test for write buffer; fixed bugs.