Fixed compilation errors
Minor improvements