Replace extraneous equality sign
Remove redundant _id field
Optimize code
Optimize code; Switch to correct directory on script shutdown
Remove redundant instances of session_commit()