fixed some problems after last merge