fixed issues regarding type inference