fixed various issues that were failing unit tests