Fix some API and GUI problems