fixes for #328 and #330

clears the undefined constant notice to fix #328
adds `$output="";` to fix #330 notice