fixed raiseNotDefined, sortedKeys methods