Fixed bugs with Merge request #41.