Fixed several issues

(see jira)