Fixed test results, refactored issues