Adding an error check for an odd element condition that occurs occasionally when doing jasmine testing.