Settings: Remove old code and fix some bug