Modified source from Elastica\Prefix class