Removed unused variable and moved diagnostic warning.