Few bits of cleaning up

This library produced quite a lot of warnings but only from a few things. I have corrected the bugs