Code-cleanup. Small fixes and finaly $uplo is at it's place!