Fixes one or two minor bugs, and also puts more work into preferences menu.