Fixed bug found by compiler warning.