Improve output error messages
Fix style and more