Fixed many issues (see jira)