Fixing bugs in edit windows

Adds some logic to the UI and model