Fixes from Blazej