Added error and phone event handling.