Hack to work with older tomcat.
Turn empty location strings into null.
Fix order of events.