Attempt to fix eager initialization in Spark