fixed fatal crash at checkout, minor cleanup