Fixes #27 (disable fields and buttons in popup when readonly is true)
Clears a bunch of warnings