fixed assorted bugs