fixed or worked around some bugs