Block event on buttons added.

Improvements, clean-up and comments.
Warning supression.
Minor improvements.