Cleaned the code and unit tests. Refs #8646.