WIP various fixes