fixed some bugs etc.