Various fixes made