Fixed bug that threw an error on first run.