NB: This was the main issue. It should have been checking presence of 'spillFile' before bailing out if no rows in buffer.