Bug fixes and functions for dealing with set files