Various fixes master branch