Fixed tiny bug that would cause crash with an error in some cases