Master

Updated pull request with bugfixes