Fixed issues on replication
Minor: added on shutdown if profiler is defined to avoid NPE
Minor: added toString() in SQL eval() to avoid CCE and to parse any object