Fixes from Mike branch