Fixing buggy behaviour