Cleanup and add incorrect implementation of readExtended