Removed redudant if statement. Fixed incorrect unittest