fixed some issues, also added first pass at post-processing search/replace strings in SQL file