Fix for both problems