Fix compile warnings
Remove more warnings
Remove compiler warnings
Remove unused variable
Remove unused variable
Fix compiler warnings
Remove unused variable
Use correct return codes and variable types