Cleaned up some event firing code.