Yep, wasn't too sure about the behaviour of SEEK_SET when I initially wrote this. Thanks for catching it - fixed.