Corrected palm transformation. Various improvements