Extract modal code into include
Make download button work on custom pages
Fix if no register id field is found