various bugfixes; successfully used on sky and working