Improve install proc and a few fixes for sql 2005