Fixed issues brought to my attention by Andrew regarding illeagal param declarations etc. Also tweaked string handling