Fixed NullPointer and After-Merge Bug