Fixed occasional NullPointer