Various improvements, fixes