Fixed a seg fault caused by the last commit.