fixed sign errors in prepareupdates