Fixed reorder warnings, and optimized for code coverage.