nil fix in type spec
adding back in (commented out) code for buffering writes. i want to have it handy for easy testing