fixed uidl problems and added tests