Fixed some warnings + passing reference instead of pointer for some
position