fixed some irritating bugs