Fix some problems and suppress warning