Fix warnings

Fix some static analizer warnings