Avoid compiler warnings

Fix several lines of code to avoid compiler warnings