Minor bug fixes and added conn.commit() to save changes to database