Fix unused variable warnings when asserts are disabled