Better logging of errors
Fixes possible crash on start
Styling