Fix misc bugs
Format
Add settings
Add some more misc API