Fix some bugs and UE