Various fixes