Fixed many minor warnings to keep compiler happy :)