Clean up logic in MSR read/write functions.