Fix bug with the loop.

Stop always setting the variable event to a function. Also print a well formatted string.