Partial fixes to spark module.