Added support for editable inputs

And fixed some bugs.