Ensure that JSON representation of error dictionaries use string keys.
Add profiling code