Minor fixes in sparse generator