merged latest features from master to gap-2-8 branch + fixed some deprecated calls.