Correct implementation of fix-17

This addresses the issues raised in [#22](https://github.com/angular-ui/ui-tinymce/pull/22) and fixes [#18](https://github.com/angular-ui/ui-tinymce/pull/18).