bugfixes and improved preferences layout