Cleaned up some comments; added an assertion to check for future encoding inconsitencies