Add handling for sandbox reservation duration expiration and some code cleanup.