Added double dontent handling, minor improovements