Sort keys in curve ctor