Adjust to work better with i3.
Improve error reporting.