mike's bugs fixes