Fixing NullPointerException.