Fixed a potentially crashing error.