Fixed scripting issues and normalized sproc body with begin and end