Fixed another bug with jquery patch + added more tests