Fixed an eternal loop that was caused by correctly working vectors and
an unchecked return value.