improved preferences and some fixes