Fixed potential NullPointerException.