Some broken unit tests were fixed. Code clean-up was performed.