Some fixes for incompatible data type and in function declaration