Reflecting changes from OmnisCore.
Cleaned up.