Fixed several bugs and added some features
Merge pull request #789 from mannol1/master

Fixed several bugs and added some features