Improved a few things to get rid of compiler warnings