Change code style
Add more diagnostic output