Some fixes and changed typedefof for typeof