Code cleanup, update check fixes