Bugfixing

Fixed some bugs related to the merge of the branches