fix and enhanced tests