further bug fixes related to handling sets