div bugfixes and improvements