Bad param escaping and extra parenthesis fix