Bugfix of sparese function