General fixes and test coverage from 88% to 99%.