Fixed a error that caused console to spew errors in some cases.