Create preferences fragment and bugs fixed