Changed console to window.console, renamed the PAPIs delete method and removed an extra comma for IE compability.